package org.example.feign.client;

import org.example.feign.fallback.UserClientFallback;
import org.example.feign.fallback.UserClientFallbackFactory;
import org.example.pojo.Product;
import org.example.pojo.UserVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "service-provider"
//        ,fallback = UserClientFallback.class
,fallbackFactory = UserClientFallbackFactory.class
)
public interface UserClient {
    @GetMapping("/api/user")
    UserVo getUser(@RequestParam("userId") Integer userId);
    @GetMapping("/api/product")
    public List<Product> getList();
}
